package partTwo;
/**
 * 本类用于练习面向对象2
 */
public class TestTeacher {
    public static void main(String[] args) {
        Teacher t1 = new Teacher();
        Teacher t2 = new Teacher();
        Teacher t3 = new Teacher();

        // 1.创建老师类对象t1，所授课目为CGB，姓名为泡泡
        t1.setSubject("CGB");
        t1.setName("泡泡");
        System.out.println(t1.getSubject());
        System.out.println(t1.getName());
        //2.创建老师类对象t2，工号为13089，部门为java教研二部
        t2.setNum(13089);
        t2.setDept("java教研二部");
        System.out.println(t2.getNum());
        System.out.println(t2.getDept());
        //3.创建老师类对象t3，姓名为涛涛，工号为10086，部门为java教研一部，所授课目为SCD
        t3.setName("涛涛");
        t3.setNum(10086);
        t3.setDept("java教研一部");
        t3.setSubject("SCG");
        System.out.println(t3.getName());
        System.out.println(t3.getNum());
        System.out.println(t3.getDept());
        System.out.println(t3.getSubject());


    }
}


//1.定义老师类
//1.1 属性：姓名 工号  部门 所授科目   并封装
//1.2 功能：备课方法  授课方法
class Teacher {
    private String name;
    private int num;
    private String dept;
    private String subject;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public int getNum() {
        return num;
    }
    public void setNum(int num) {
        this.num = num;
    }

    public String getDept() {
        return dept;
    }
    public void setDept(String dept) {
        this.dept = dept;
    }

    public String getSubject() {
        return subject;
    }
    public void setSubject(String subject) {
        this.subject = subject;
    }

    //1.2 提供功能
    public void ready(){
        System.out.println("正在备课中");

    }
    public void teach(){
        System.out.println("正在授课中");

    }
}
